package com.zcl.demo.concurrent;

import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author: zcl
 * @date: 2021/1/8 19:58
 * @description:
 */
public class AtomicIntegerDemo {
    static int i = 0;
    static AtomicInteger j = new AtomicInteger(0);

    public static void main(String[] args) {
        for (int k = 0; k < 1000000; k++) {
            new Thread() {
                @Override
                public void run() {
                    System.out.println(AtomicIntegerDemo.j.incrementAndGet());
                }
            }.start();

        }
    }
}
